<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  

  
  <title>ibasara</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:type" content="website">
<meta property="og:title" content="ibasara">
<meta property="og:url" content="https://ibasara.gitee.io/index.html">
<meta property="og:site_name" content="ibasara">
<meta property="og:locale" content="en_US">
<meta property="article:author" content="ibasara">
<meta name="twitter:card" content="summary">
  
    <link rel="alternate" href="/atom.xml" title="ibasara" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 4.2.1"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">ibasara</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="Search"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://ibasara.gitee.io"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main">
  
    <article id="post-hexo" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2020/06/13/hexo/" class="article-date">
  <time datetime="2020-06-13T00:42:58.000Z" itemprop="datePublished">2020-06-13</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2020/06/13/hexo/">hexo</a>
    </h1>
  

      </header>
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="环境"><a href="#环境" class="headerlink" title="环境"></a>环境</h2><ul>
<li>nodejs</li>
</ul>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">npm install -g hexo         <span class="comment"># 通过npm安装hexo</span></span><br><span class="line">npm install -g hexo-cli</span><br><span class="line"><span class="comment"># -g 指定全局安装，可以使用hexo命令</span></span><br><span class="line">hexo init <span class="built_in">test</span>      <span class="comment"># 初始化创建，会创建test文件夹</span></span><br><span class="line"><span class="built_in">cd</span> <span class="built_in">test</span>             <span class="comment"># 进入test目录</span></span><br><span class="line">npm install         <span class="comment"># 进一步安装hexo所需文件</span></span><br><span class="line"></span><br><span class="line">hexo clean          <span class="comment"># 清除缓存文件和已生成的静态文件</span></span><br><span class="line">hexo generate       <span class="comment"># 生成静态文件</span></span><br><span class="line">hexo g</span><br><span class="line">hexo server         <span class="comment"># 启动服务</span></span><br><span class="line">hexo s</span><br><span class="line">hexo deploy         <span class="comment"># 部署网站</span></span><br><span class="line">hexo d</span><br><span class="line"></span><br><span class="line">hexo new [layout] &lt;xxx&gt;       <span class="comment"># 新建一篇文章,如果没有设置 layout，默认使用 _config.yml 中的 default_layout 参数代替。在test/source/_layout下会生成xxx.md文件</span></span><br></pre></td></tr></table></figure>

<h2 id="gitee-pages"><a href="#gitee-pages" class="headerlink" title="gitee pages"></a>gitee pages</h2><p>修改配置文件<br>_config.yml</p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">url:</span> <span class="string">http://ibasara.gitee.io</span></span><br><span class="line"><span class="attr">root:</span> <span class="string">/</span></span><br></pre></td></tr></table></figure>

<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">deploy:</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">git</span></span><br><span class="line">  <span class="attr">repo:</span> <span class="string">https://gitee.com/ibasara/ibasara.git</span></span><br></pre></td></tr></table></figure>

<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-deployer-git --save    # 安装git插件</span><br><span class="line">hexo deploy # 上传到gitee</span><br><span class="line">hexo clean &amp;&amp; hexo g &amp;&amp; hexo d  # 清理&amp;更新&amp;部署一条龙</span><br></pre></td></tr></table></figure>
      
    </div>
    <footer class="article-footer">
      <a data-url="https://ibasara.gitee.io/2020/06/13/hexo/" data-id="ckbcx49io0000co550p8veba7" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
</article>


  


</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Archives</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/06/">June 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">Recent Posts</h3>
    <div class="widget">
      <ul>
        
          <li>
            <a href="/2020/06/13/hexo/">hexo</a>
          </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 ibasara<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
</body>
</html>